//
//  ZZLightLineCell.m
//  ZZBlue
//
//  Created by evan on 2017/10/16.
//  Copyright © 2017年 stonesMonkey. All rights reserved.
//

#import "ZZLightLineCell.h"
#import "ZZLightLineModel.h"
@interface ZZLightLineCell()

@property (weak, nonatomic) IBOutlet UILabel *nameLabel;

@property (weak, nonatomic) IBOutlet UIView *lightView;


@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;




@end

@implementation ZZLightLineCell

- (void)awakeFromNib {
    [super awakeFromNib];

    self.lightView.layer.cornerRadius = 5;
    self.lightView.layer.masksToBounds = YES;
}

- (IBAction)settingBtnClick:(UIButton *)sender {

    if (self.addBtnClick) {

        self.addBtnClick(self.model);
    }

    if (self.setBtnClick) {

        self.setBtnClick();
    }
}

- (void)setModel:(ZZLightLineModel *)model {

    _model = model;

    self.nameLabel.text = model.title;
    NSString *path_document = NSHomeDirectory();
    NSString *imagePath = [path_document stringByAppendingString:[NSString stringWithFormat:@"/Documents/%@",model.imagePath]];
    self.iconImageView.image = [UIImage imageWithContentsOfFile:imagePath];

}

@end

